home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 September / maximum-cd-2000-09.iso / Vampire the Masquerade / vampire_demo.exe / Codex.nob / Lightning.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  1.4 KB  |  61 lines

  1. public class Lightning extends Codex {
  2.    public void beginscene(int clientGuid, int captureID) {
  3.       Codex.DisableLightStyle(7);
  4.       Codex.MaterialSetFrame("lightning1", 0);
  5.       Codex.DisableLightStyle(8);
  6.       Codex.MaterialSetFrame("lightning2", 0);
  7.       Codex.DisableLightStyle(9);
  8.       Codex.MaterialSetFrame("lightning3", 0);
  9.       Codex.MaterialSetFrame("lightningflare1", 0);
  10.       Codex.MaterialSetFrame("lightningflare2", 0);
  11.       Codex.MaterialSetFrame("lightningflare3", 0);
  12.       ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 7, 0.0F);
  13.       ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 8, 0.0F);
  14.       ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 9, 0.0F);
  15.    }
  16.  
  17.    public void timer(int timerID, float arg0, float arg1, float arg2, float arg3) {
  18.       switch (timerID) {
  19.          case 7:
  20.             if (arg0 == 1.0F) {
  21.                Codex.DisableLightStyle(7);
  22.                Codex.MaterialSetFrame("lightning1", 0);
  23.                Codex.MaterialSetFrame("lightningflare1", 0);
  24.                ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 7, 0.0F);
  25.             } else {
  26.                Codex.EnableLightStyle(7);
  27.                Codex.MaterialSetFrame("lightning1", 1);
  28.                Codex.MaterialSetFrame("lightningflare1", 1);
  29.                ((Codex)this).SetTimer(0.2F, 7, 1.0F);
  30.             }
  31.             break;
  32.          case 8:
  33.             if (arg0 == 1.0F) {
  34.                Codex.DisableLightStyle(8);
  35.                Codex.MaterialSetFrame("lightning2", 0);
  36.                Codex.MaterialSetFrame("lightningflare2", 0);
  37.                ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 8, 0.0F);
  38.             } else {
  39.                Codex.EnableLightStyle(8);
  40.                Codex.MaterialSetFrame("lightning2", 1);
  41.                Codex.MaterialSetFrame("lightningflare2", 1);
  42.                ((Codex)this).SetTimer(0.2F, 8, 1.0F);
  43.             }
  44.             break;
  45.          case 9:
  46.             if (arg0 == 1.0F) {
  47.                Codex.DisableLightStyle(9);
  48.                Codex.MaterialSetFrame("lightning3", 0);
  49.                Codex.MaterialSetFrame("lightningflare3", 0);
  50.                ((Codex)this).SetTimer((float)((double)1.0F + Math.random() * (double)3.0F), 9, 0.0F);
  51.             } else {
  52.                Codex.EnableLightStyle(9);
  53.                Codex.MaterialSetFrame("lightning3", 1);
  54.                Codex.MaterialSetFrame("lightningflare3", 1);
  55.                ((Codex)this).SetTimer(0.2F, 9, 1.0F);
  56.             }
  57.       }
  58.  
  59.    }
  60. }
  61.